<?php

	function file_extension($filename)
	{
		$filename = basename($filename);//kill the paths
		return substr($filename, strrpos($filename, '.'));
	}